Junio C Hamano | 5825687 | 2007-12-04 08:31:13 | [diff] [blame] | 1 | git-help(1) |
| 2 | =========== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-help - display help information about git |
| 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 10 | 'git help' [-a|--all|-i|--info|-m|--man|-w|--web] [COMMAND] |
Junio C Hamano | 5825687 | 2007-12-04 08:31:13 | [diff] [blame] | 11 | |
| 12 | DESCRIPTION |
| 13 | ----------- |
| 14 | |
| 15 | With no options and no COMMAND given, the synopsis of the 'git' |
| 16 | command and a list of the most commonly used git commands are printed |
| 17 | on the standard output. |
| 18 | |
| 19 | If the option '--all' or '-a' is given, then all available commands are |
| 20 | printed on the standard output. |
| 21 | |
| 22 | If a git command is named, a manual page for that command is brought |
Junio C Hamano | 0c0da5f | 2007-12-13 02:45:30 | [diff] [blame] | 23 | up. The 'man' program is used by default for this purpose, but this |
Junio C Hamano | fe98605 | 2007-12-19 07:33:38 | [diff] [blame] | 24 | can be overridden by other options or configuration variables. |
Junio C Hamano | 5825687 | 2007-12-04 08:31:13 | [diff] [blame] | 25 | |
| 26 | Note that 'git --help ...' is identical as 'git help ...' because the |
| 27 | former is internally converted into the latter. |
| 28 | |
| 29 | OPTIONS |
| 30 | ------- |
| 31 | -a|--all:: |
Junio C Hamano | 5825687 | 2007-12-04 08:31:13 | [diff] [blame] | 32 | Prints all the available commands on the standard output. This |
Junio C Hamano | fe98605 | 2007-12-19 07:33:38 | [diff] [blame] | 33 | option supersedes any other option. |
Junio C Hamano | 5825687 | 2007-12-04 08:31:13 | [diff] [blame] | 34 | |
Junio C Hamano | 0c0da5f | 2007-12-13 02:45:30 | [diff] [blame] | 35 | -i|--info:: |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 36 | Display manual page for the command in the 'info' format. The |
| 37 | 'info' program will be used for that purpose. |
Junio C Hamano | 0c0da5f | 2007-12-13 02:45:30 | [diff] [blame] | 38 | |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 39 | -m|--man:: |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 40 | Display manual page for the command in the 'man' format. This |
| 41 | option may be used to override a value set in the |
| 42 | 'help.format' configuration variable. |
| 43 | + |
| 44 | By default the 'man' program will be used to display the manual page, |
| 45 | but the 'man.viewer' configuration variable may be used to choose |
| 46 | other display programs (see below). |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 47 | |
Junio C Hamano | 0c0da5f | 2007-12-13 02:45:30 | [diff] [blame] | 48 | -w|--web:: |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 49 | Display manual page for the command in the 'web' (HTML) |
| 50 | format. A web browser will be used for that purpose. |
Junio C Hamano | 0c0da5f | 2007-12-13 02:45:30 | [diff] [blame] | 51 | + |
| 52 | The web browser can be specified using the configuration variable |
| 53 | 'help.browser', or 'web.browser' if the former is not set. If none of |
Junio C Hamano | 26e590a | 2008-02-17 03:53:51 | [diff] [blame] | 54 | these config variables is set, the 'git-web--browse' helper script |
| 55 | (called by 'git-help') will pick a suitable default. See |
| 56 | linkgit:git-web--browse[1] for more information about this. |
Junio C Hamano | 0c0da5f | 2007-12-13 02:45:30 | [diff] [blame] | 57 | |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 58 | CONFIGURATION VARIABLES |
| 59 | ----------------------- |
| 60 | |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 61 | help.format |
| 62 | ~~~~~~~~~~~ |
| 63 | |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 64 | If no command line option is passed, the 'help.format' configuration |
| 65 | variable will be checked. The following values are supported for this |
| 66 | variable; they make 'git-help' behave as their corresponding command |
| 67 | line option: |
| 68 | |
| 69 | * "man" corresponds to '-m|--man', |
| 70 | * "info" corresponds to '-i|--info', |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 71 | * "web" or "html" correspond to '-w|--web'. |
| 72 | |
| 73 | help.browser, web.browser and browser.<tool>.path |
| 74 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 75 | |
| 76 | The 'help.browser', 'web.browser' and 'browser.<tool>.path' will also |
Junio C Hamano | fe98605 | 2007-12-19 07:33:38 | [diff] [blame] | 77 | be checked if the 'web' format is chosen (either by command line |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 78 | option or configuration variable). See '-w|--web' in the OPTIONS |
Junio C Hamano | 26e590a | 2008-02-17 03:53:51 | [diff] [blame] | 79 | section above and linkgit:git-web--browse[1]. |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 80 | |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 81 | man.viewer |
| 82 | ~~~~~~~~~~ |
| 83 | |
| 84 | The 'man.viewer' config variable will be checked if the 'man' format |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 85 | is chosen. The following values are currently supported: |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 86 | |
| 87 | * "man": use the 'man' program as usual, |
| 88 | * "woman": use 'emacsclient' to launch the "woman" mode in emacs |
| 89 | (this only works starting with emacsclient versions 22), |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 90 | * "konqueror": use 'kfmclient' to open the man page in a new konqueror |
| 91 | tab (see 'Note about konqueror' below). |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 92 | |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 93 | Values for other tools can be used if there is a corresponding |
| 94 | 'man.<tool>.cmd' configuration entry (see below). |
| 95 | |
| 96 | Multiple values may be given to the 'man.viewer' configuration |
| 97 | variable. Their corresponding programs will be tried in the order |
| 98 | listed in the configuration file. |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 99 | |
| 100 | For example, this configuration: |
| 101 | |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 102 | ------------------------------------------------ |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 103 | [man] |
| 104 | viewer = konqueror |
| 105 | viewer = woman |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 106 | ------------------------------------------------ |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 107 | |
| 108 | will try to use konqueror first. But this may fail (for example if |
| 109 | DISPLAY is not set) and in that case emacs' woman mode will be tried. |
| 110 | |
| 111 | If everything fails the 'man' program will be tried anyway. |
| 112 | |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 113 | man.<tool>.path |
| 114 | ~~~~~~~~~~~~~~~ |
| 115 | |
| 116 | You can explicitly provide a full path to your preferred man viewer by |
| 117 | setting the configuration variable 'man.<tool>.path'. For example, you |
| 118 | can configure the absolute path to konqueror by setting |
| 119 | 'man.konqueror.path'. Otherwise, 'git help' assumes the tool is |
| 120 | available in PATH. |
| 121 | |
| 122 | man.<tool>.cmd |
| 123 | ~~~~~~~~~~~~~~ |
| 124 | |
| 125 | When the man viewer, specified by the 'man.viewer' configuration |
| 126 | variables, is not among the supported ones, then the corresponding |
| 127 | 'man.<tool>.cmd' configuration variable will be looked up. If this |
| 128 | variable exists then the specified tool will be treated as a custom |
| 129 | command and a shell eval will be used to run the command with the man |
| 130 | page passed as arguments. |
| 131 | |
| 132 | Note about konqueror |
| 133 | ~~~~~~~~~~~~~~~~~~~~ |
| 134 | |
| 135 | When 'konqueror' is specified in the 'man.viewer' configuration |
| 136 | variable, we launch 'kfmclient' to try to open the man page on an |
| 137 | already opened konqueror in a new tab if possible. |
| 138 | |
| 139 | For consistency, we also try such a trick if 'man.konqueror.path' is |
| 140 | set to something like 'A_PATH_TO/konqueror'. That means we will try to |
| 141 | launch 'A_PATH_TO/kfmclient' instead. |
| 142 | |
| 143 | If you really want to use 'konqueror', then you can use something like |
| 144 | the following: |
| 145 | |
| 146 | ------------------------------------------------ |
| 147 | [man] |
| 148 | viewer = konq |
| 149 | |
| 150 | [man "konq"] |
| 151 | cmd = A_PATH_TO/konqueror |
| 152 | ------------------------------------------------ |
| 153 | |
Junio C Hamano | 8b588d5 | 2008-03-15 09:48:37 | [diff] [blame] | 154 | Note about git config --global |
| 155 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 156 | |
| 157 | Note that all these configuration variables should probably be set |
| 158 | using the '--global' flag, for example like this: |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 159 | |
| 160 | ------------------------------------------------ |
| 161 | $ git config --global help.format web |
| 162 | $ git config --global web.browser firefox |
| 163 | ------------------------------------------------ |
| 164 | |
| 165 | as they are probably more user specific than repository specific. |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 166 | See linkgit:git-config[1] for more information about this. |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 167 | |
Junio C Hamano | 5825687 | 2007-12-04 08:31:13 | [diff] [blame] | 168 | Author |
| 169 | ------ |
| 170 | Written by Junio C Hamano <gitster@pobox.com> and the git-list |
| 171 | <git@vger.kernel.org>. |
| 172 | |
| 173 | Documentation |
| 174 | ------------- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 175 | Initial documentation was part of the linkgit:git[1] man page. |
Junio C Hamano | 5825687 | 2007-12-04 08:31:13 | [diff] [blame] | 176 | Christian Couder <chriscool@tuxfamily.org> extracted and rewrote it a |
| 177 | little. Maintenance is done by the git-list <git@vger.kernel.org>. |
| 178 | |
| 179 | GIT |
| 180 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 181 | Part of the linkgit:git[1] suite |